<?php

/**
 * This file is part of the Pagizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Pagizer Core Team <team@pagizer.org>
 * @package     Pagizer
 * @subpackage  backoffice
 */

class m_backoffice_actions_AjaxGetUrlAction extends m_backoffice_extends_Action
{
	public function execute()
	{
        $params = $this->getRequest()->getParameters();

        $routeName = $params['route'][0];

    	unset($params['module']);
    	unset($params['action']);
    	unset($params['route']);

        $cleanParams = array();
        foreach($params as $k => $p)
        {
            $cleanParams[$k] = $p[0];
        }

        if(isset($cleanParams['docLang']))
        {
            $cleanParams['docLang'] = strtolower($cleanParams['docLang']);
        }

        echo f_core_Routing::getUrl($routeName, $cleanParams);
	}	
	
	public function errorHandler()
	{
		return null;
	}
}